﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using ColorApplication.Helper;

namespace ColorApplication
{
    public class Common
    {
        public static string GetTextByPageName(string PageName)
        {
            DataSet ds = new DataSet();
            using (SqlConnection con = new SqlConnection())
            {
                SqlParameter[] parameters = {
                                                new SqlParameter("@PageName", PageName),
                                                
                                            };

                SqlCommand cmd = SQLHelper.GetCommand(con, "CheckPageNameExistinContent", parameters);
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);
                con.Close();
            }

            if (ds.Tables[0].Rows.Count>0)
            {
                return ds.Tables[0].Rows[0]["Text"].ToString();
            }

            return string.Empty;

        }
    }
}